package com.module.controller;


import com.module.framework.domain.Order;
import com.module.framework.domain.ResponseResult;
import com.module.framework.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lexang
 * @since 2022-03-04
 */
@RestController
@RequestMapping("/admin/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/list")
    public ResponseResult list(Integer pageNum, Integer pageSize,Integer userId) {
        return ResponseResult.okResult(orderService.orderList(pageNum, pageSize,userId));
    }

    @GetMapping("/product")
    public ResponseResult list(Integer orderId) {
        return ResponseResult.okResult(orderService.orderProductList(orderId));
    }

    @PostMapping("/add")
    public ResponseResult add(@RequestBody Order order) {
        return ResponseResult.okResult();
    }

    @PostMapping("/update")
    public ResponseResult update(@RequestBody Order order) {
        return ResponseResult.okResult();
    }

    @GetMapping("/delete")
    public ResponseResult delete(Integer id) {
        return ResponseResult.okResult();
    }
}

